import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/home/home'
// import mine from '../views/mine/mine'
// import login from '../views/login/login'
// import layout from '../views/layout/layout'
// import search1 from '../views/search/search'
// import articlesinfo from '../views/articlesinfo/articlesinfo'
// import userinfo from '@/views/userinfo/userinfo'
// import customerservice from '@/views/customerservice/customerservice'
// import searchresults from '@/views/search/searchresults'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    component: () => import(/* webpackChunkName: "Layout" */ '../views/login/login'),
  },
  {
    path: '/layout',
    component: () => import(/* webpackChunkName: "Layout" */ '../views/layout/layout'),
    children: [
      {
        path: '/',
        redirect: 'home'
      },
      {
        path: 'home',
        component: home,
        meta: {
          scrollY: 0
        }
      },
      {
        path: 'mine',
        component: () => import(/* webpackChunkName: "Layout" */ '../views/mine/mine'),
      }
    ]
  },
  {
    path: '/search1',
    component: () => import(/* webpackChunkName: "Layout" */ '../views/search/search'),
  },
  {
    path: '/articlesinfo/:id',
    component: () => import(/* webpackChunkName: "Layout" */ '../views/articlesinfo/articlesinfo'),
  },
  {
    path: '/userinfo',
    component: () => import(/* webpackChunkName: "Layout" */ '@/views/userinfo/userinfo'),
  },
  {
    path: '/customerservice',
    component: () => import(/* webpackChunkName: "Layout" */ '@/views/customerservice/customerservice'),
  },
  {
    path: '/searchresults/:id',
    component: () => import(/* webpackChunkName: "Layout" */ '@/views/search/searchresults'),
  }
]

const router = new VueRouter({
  routes
})

export default router
